And make IVT_DEBUG_MAX changable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
HAS_VGA := y
xenoprof := y
no_warns ?= n
+vti_debug ?= n
xen_ia64_expose_p2m ?= y
xen_ia64_pervcpu_vhpt ?= y
xen_ia64_tlb_track ?= y
CFLAGS += -DIA64 -DXEN -DLINUX_2_6
CFLAGS += -ffixed-r13 -mfixed-range=f2-f5,f12-f127,b2-b5
CFLAGS += -g
-#CFLAGS += -DVTI_DEBUG
+ifeq ($(vti_debug),y)
+CFLAGS += -DVTI_DEBUG
+endif
ifeq ($(xen_ia64_expose_p2m),y)
CFLAGS += -DCONFIG_XEN_IA64_EXPOSE_P2M
endif
#ifdef VTI_DEBUG
DEFINE(IVT_CUR_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_current));
DEFINE(IVT_DBG_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_debug));
+ DEFINE(IVT_DEBUG_SIZE, sizeof(struct ivt_debug));
#endif
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
#ifdef VTI_DEBUG
+#define IVT_DEBUG_MASK (IVT_DEBUG_SIZE * (IVT_DEBUG_MAX - 1))
#define VMX_DBG_FAULT(i) \
add r16=IVT_CUR_OFS,r21; \
add r17=IVT_DBG_OFS,r21;; \
mov r22=cr.ifa; \
mov r23=i;; \
st8 [r17]=r19,8; \
- add r18=32,r18;; \
+ add r18=IVT_DEBUG_SIZE,r18;; \
st8 [r17]=r20,8; \
- mov r19=0xfe0;; \
+ mov r19=IVT_DEBUG_MASK;; \
st8 [r17]=r22,8; \
and r18=r19,r18;; \
st8 [r17]=r23; \
}
new_psr.val=VCPU(vcpu, vpsr);
#ifdef VTI_DEBUG
- {
- struct pt_regs *regs = vcpu_regs(vcpu);
guest_psr_buf[guest_psr_index].ip = regs->cr_iip;
guest_psr_buf[guest_psr_index].psr = new_psr.val;
if (++guest_psr_index >= 100)
guest_psr_index = 0;
- }
#endif
#if 0
if (old_psr.i != new_psr.i) {
#ifndef _ASM_IA64_VMX_VPD_H_
#define _ASM_IA64_VMX_VPD_H_
+#ifdef VTI_DEBUG
+/*
+ * must be power of 2.
+ * Be carefull to avoid stack over flow keeping
+ * struct arch_vmx_struct(i.e. struct vcpu) small enough.
+ * sizeof(struct ivt_debug) * IVT_DEBUG_MAX = 32 * IVT_DEBUG_MAX
+ */
+//#define IVT_DEBUG_MAX 128 /* 4096 bytes */
+#define IVT_DEBUG_MAX 16 /* 512 bytes */
+#endif
+
#ifndef __ASSEMBLY__
#include <asm/vtm.h>
unsigned long ifa;
unsigned long vector;
};
-#define IVT_DEBUG_MAX 128
#endif
struct arch_vmx_struct {